Skip to content

frontend Sidebar: Improve performance by moving isSelected logic to the parent component#2638

Merged
illume merged 1 commit intomainfrom
sidebar-perf
Jan 7, 2025
Merged

frontend Sidebar: Improve performance by moving isSelected logic to the parent component#2638
illume merged 1 commit intomainfrom
sidebar-perf

Conversation

@sniok
Copy link
Contributor

@sniok sniok commented Dec 5, 2024

With this change only items that were updated will rerender

How to test

  • The sidebar should act as before.
  • Add console logs inside the sidebar items to confirm they are rendering less

@sniok sniok force-pushed the sidebar-perf branch 2 times, most recently from 6b65c95 to 11382dd Compare December 12, 2024 13:29
@sniok sniok marked this pull request as ready for review December 12, 2024 14:57
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 12, 2024
@illume illume added frontend Issues related to the frontend performance labels Dec 30, 2024
Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

I left some notes.

Can you please leave in the PR description how to test?

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 2, 2025
Change logic that determines if the item is selected to the parent
component. This allows for better memoization of individual items.

Signed-off-by: Oleksandr Dubenko <oldubenko@microsoft.com>
@illume
Copy link
Contributor

illume commented Jan 7, 2025

I added a how to test section to the PR description.

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks! Nice improvement.

@dosubot dosubot bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 7, 2025
@illume illume merged commit 1888f9f into main Jan 7, 2025
17 checks passed
@illume illume deleted the sidebar-perf branch January 7, 2025 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Issues related to the frontend lgtm "Looks good to me", indicates that a PR is ready to be merged. performance size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants